package main

import "fmt"

func main() {
	num := 4

	switch num {		//指定某个变量
	case 1:
		fmt.Printf("num1 is %d", num)
	case 2:
		fmt.Printf("num2 is %d", num)
		//fallthrough  //默认无条件执行紧挨着的语句，不会判断真假
	case 3,4:   //匹配多个值
		fmt.Printf("num4 is %d", num)

	default:
		fmt.Printf("num6 is %d", num)
	}

	score := 30
	switch {
	case score >= 90:
		fmt.Println("优秀")
	case score >=80 && score < 90:
		fmt.Println("良好")
	case score >=70 && score < 80:
		fmt.Println("合格")
	case score>=60 && score < 70:
		fmt.Println("及格")
	default:
		fmt.Println("不及格")
	}
}
